Skip to content

Conversation

siverne
Copy link
Member

@siverne siverne commented Nov 23, 2026

Closes #101

What

  • Gives main a minimum height of one screen (AppLayout.module.css), so the footer starts below the fold.
  • Fills in the budget table and the sustainability section in README with numbers measured on the VM (Full dataset).
  • Changes the search scenario from red to white wine, since there are only 7 red rieslings, too few for a second page.
  • Removes the known issue about the «Rødvin» e2e test, which was fixed in Tick a filter at once, not after the URL has changed (#68) #92.

Why

Lighthouse (mobile) on the VM gave performance 78, and the main reason was Cumulative Layout Shift: 0.356, where under 0.1 is good. While a page's code loaded, only «Laster …» was in main, so the footer sat high up and was pushed down when the page came. Lighthouse named the footer as the cause of 0.340 of it.

Numbers

Measured Budget
Landing page, first visit 172.5 kB (163.6 kB JS) 300 kB (150 kB JS)
Landing page, repeat visit 6.6 kB
Wine page, first / repeat visit 173.8 kB / 14.6 kB 300 kB
Search scenario 335.3 kB 500 kB
CO2 per visit (landing / search scenario) 0.026 g / 0.051 g 0.1 g
CLS, landing / search 0.356 before, 0.021 / 0.005 after 0.1

JavaScript is still over its budget. Two findings for later: the API's JSON responses are not compressed, and the built files have no Cache-Control header. Both are one line each in Apache, and are added to «Plan ahead».

How to test

  1. npm run build && npm run preview in frontend/, with the backend running.
  2. Lighthouse in Chrome (mobile, incognito) on /project2/ and /project2/sok: CLS should be under 0.1.
  3. Open /project2/finnesikke: the footer should be below the fold, and the page should look normal on desktop and mobile.
  4. npm run check passes.

The CLS numbers after the fix are measured locally. We measure on the VM again after merge and deploy.

(^Numbers above is helped and generated by Claude^)

@siverne siverne requested a review from a team as a code owner November 23, 2026 13:59
Copy link
Member

@manerlan manerlan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Checked out my self, CLS is well below threshold and everything seems to work as intended. Npm run check passes. Did take two runs, so maybe worth investigating src/app/App.test.tsx to see if it will be a reocurring issue. That was the test that timed out the first go round, Should be fine for now though, approving.

Sign in to join this conversation on GitHub.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Measure sustainability, and fix the layout shift on page load
2 participants